package com.peng.apis;

import com.peng.result.ResultData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(value = "cloud-gateway")
@Service
public interface PayFeignApi {
    //方法上的注解就是被调用方法的请求类型和地址
    //这样他就合成了http://cloud-pay-service/pay/get/all
    @GetMapping("/pay/get/all")
    //这里的返回值需要和被调用接口的返回值一致
    ResultData getOrders();

    @GetMapping("/pay/get/{id}")
    ResultData getOrder(@PathVariable("id") Integer id);

    @GetMapping(value = "/pay/circuit/{id}")
    String myCircuit(@PathVariable("id") Integer id);

    @GetMapping(value = "/pay/bulkhead/{id}")
    String myBulkhead(@PathVariable("id") Integer id);

    @GetMapping(value = "/pay/ratelimit/{id}")
    String myRatelimit(@PathVariable("id") Integer id);

    @GetMapping(value = "/pay/micrometer/{id}")
    String myMicrometer(@PathVariable("id") Integer id);

    @GetMapping(value = "/pay/gateway/get/{id}")
    ResultData getById(@PathVariable("id") Integer id);

    @GetMapping(value = "/pay/gateway/info")
    ResultData getGatewayInfo();

}